//
//  Base.h
//  Gfbase
//
//  Created by 谷丰 on 2025/3/24.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN

@interface BaseWay : NSObject
//域名
+(NSString *)BasePostUrlWith:(NSString *)index;
+ (instancetype)sharedManager;

// 普通 POST 请求
+ (void)postWithURL:(NSString *)url
         parameters:(id)parameters
            success:(void (^)(id response))success
            failure:(void (^)(NSError *error))failure;

// 普通 GET 请求
+ (void)getWithURL:(NSString *)url
        parameters:(id)parameters
           success:(void (^)(id response))success
           failure:(void (^)(NSError *error))failure;

// 上传图片
+ (void)uploadImageWithURL:(NSString *)url
                parameters:(id)parameters
                    images:(NSArray<UIImage *> *)images
                   success:(void (^)(id response))success
                   failure:(void (^)(NSError *error))failure;

// 上传视频
+ (void)uploadVideoWithURL:(NSString *)url
                parameters:(id)parameters
                    videoURL:(NSURL *)videoURL
                   success:(void (^)(id response))success
                   failure:(void (^)(NSError *error))failure;
// Token 相关方法
+ (void)saveToken:(NSString *)token;
+ (NSString *)getToken;
+ (void)clearToken;


// Accid 相关方法
+ (void)saveAccid:(NSString *)Accid;
+ (NSString *)getAccid;
+ (void)clearAccid;

// IMToken 相关方法
+ (void)saveIMToken:(NSString *)IMToken;
+ (NSString *)getIMToken;
+ (void)clearIMToken;

// UserID 相关方法
+ (void)saveUserID:(NSString *)userID;
+ (NSString *)getUserID;
+ (void)clearUserID;

// 是否第一次安装 APP
+ (BOOL)isFirstLaunch;
+ (void)setFirstLaunchCompleted;

//语言存储本地
+(void)FillLangue:(NSString *)Langue;
+(NSString *)Langue;
+(NSString *)LangueWithString:(NSString *)str;
//判断为空
+(BOOL)isNullPoint:(NSObject*)obj;

/*
 主题色
 */
+(UIColor *)MainColor;


// 获取当前语言
+ (NSString *)currentLanguage;

// 设置应用语言
+ (void)setLanguage:(NSString *)language;

// 获取本地化字符串
+ (NSString *)localizedStringForKey:(NSString *)key;

//设定textfiledleftview
+(void)Textfiled:(UITextField *)textfiled AndViewWithImage:(NSString *)imageName andWithType:(NSString * )type;


@end

NS_ASSUME_NONNULL_END
